package cn.thens.kdroid.core.storage

internal class MemoryStorageNode<V> : Storage.Node<V> {
    private var cache: V? = null

    override fun get(): V {
        return cache!!
    }

    override fun put(value: V) {
        cache = value
    }

    override fun clear() {
        cache = null
    }

    override fun exists(): Boolean {
        return cache != null
    }
}
